(function () {
    return {
        initControl: function (oControl) {
            var v = oControl.value;
            v.datavar = 0;

        },
        compile: function (compileContext, doc, entity) {
            var cc = compileContext;
            var tc = cc.templateCoder;

            var dataName = cc.findDataName(doc,entity.value.datavar);

            if( dataName)
                cc.dataNames.push(dataName);

            tc.add("<div class=\"select \">");
            tc.add("<select :choices='" + dataName + ".choices' :value=\""+dataName+".value\">");
            tc.add("<option value=''>请选择</option>");
            tc.add("<each cond='"+dataName+".choices' item='choice' index='choiceIndex'>");
            tc.add("<option value='${choice}'>${choice}</option>");
            tc.add("</each>");

            tc.add("</select>");
            tc.add("</div>");
        }
    }
})();